package com.buer.storage.utils;

import java.math.BigDecimal;

/**
 * Created by Administrator on 2021/1/26.
 */
public class CommonGeneratorUtil {

    //生产ID
    public static BigDecimal generatorId(){
        String s = System.currentTimeMillis() + "";
        String i = (int) ((Math.random() * 9 + 1) * 100000)+"";
        String generatorId = s + i;

        return new BigDecimal(generatorId);
    }

    //生成装备表ProdCode
    public static String generatorProdCode(){
        //随机5位数
        String i = (int) ((Math.random() * 9 + 1) * 10000)+"";
        return "ZB"+i;
    }

    //生成二级分类编号
    public static String generatorCategoryTwoNumber(){
        //随机5位数
        String i = (int) ((Math.random() * 9 + 1) * 10000)+"";
        return "CT"+i;
    }

    //生成车辆二级分类编号
    public static String generatorCarCategoryTwo(){
        //随机5位数
        String i = (int) ((Math.random() * 9 + 1) * 10000)+"";
        return "CC"+i;
    }

    //入库订单表订单编号
    public static String generatorWorderOrderNum(){
        long time=System.currentTimeMillis();
        return "RK"+time;
    }

    //入库订单详情表订单批次编号
    public static String generatorWorderOrderDetailBatchNo(){
        long time=System.currentTimeMillis();
        return "PC"+time;
    }

    //出库订单表订单编号
    public static String generatorDorderOrderNum(){
        long time=System.currentTimeMillis();
        return "OS"+time;
    }

    //出库订单表订单编号
    public static String generatorOaBatchNo(){
        long time=System.currentTimeMillis();
        return "CHYSRK"+time;
    }

    public static void main(String[] args){
        System.out.println(generatorOaBatchNo());
    }
}
